//
// Created by 倪加奇 on 17-1-23.
// Email: drnijq@126.com
// Copyright (c) 2017 杭州威固网络科技有限公司. All rights reserved.
//

#ifndef TCP_ECHO_SERVER_TCP_ECHO_SERVER_H
#define TCP_ECHO_SERVER_TCP_ECHO_SERVER_H

#include "tcp_echo_connetion.h"

class tcp_echo_server {
public:
    tcp_echo_server (boost::asio::io_service &io_server, unsigned short listen_port);
private:
    tcp::acceptor _accepter;
    unsigned short _ns_listen_port;

    void start_accept ();
    void handle_accept(tcp_echo_connetion::pointer new_connection, const boost::system::error_code &error);
};


#endif //TCP_ECHO_SERVER_TCP_ECHO_SERVER_H
